import QtQuick 2.4

Item {
    id: buttonItem
    width: 689
    height: 470

    property alias mouseArea: mouseArea
    property alias mouseArea1: mouseArea1
    property alias text1: text1
    property alias text6: text6

    signal pageChanged(int qmlPage)
    signal startTask

    Rectangle {
        id: rectangle
        x: 8
        y: 20
        width: 325
        height: 212
        color: "#ffffff"
        radius: 20
        scale: mouseArea.pressed ? 0.9 : 1.0

        MouseArea {
            id: mouseArea
            width: 325
            height: 210
            anchors.fill: parent

            Text {
                id: text2
                y: 78
                text: qsTr("开门")
                font.family: "微软雅黑"
                font.bold: true
                anchors.left: parent.left
                anchors.leftMargin: 80
                anchors.verticalCenter: parent.verticalCenter
                font.pixelSize: 28
            }
        }
    }

    Rectangle {
        id: rectangle1
        x: 355
        y: 20
        width: 325
        height: 210
        color: "#ffffff"
        radius: 20
        scale: mouseArea1.pressed ? 0.9 : 1.0

        MouseArea {
            id: mouseArea1
            anchors.fill: parent

            Text {
                id: text5
                x: 186
                y: 99
                text: qsTr("关门")
                anchors.right: parent.right
                anchors.rightMargin: 100
                anchors.verticalCenter: parent.verticalCenter
                font.family: "微软雅黑"
                font.bold: true
                font.pixelSize: 28
            }
        }
    }

    Rectangle {
        id: rectangle2
        x: 8
        y: 252
        width: 325
        height: 210
        color: "#ffffff"
        radius: 20
        scale: mouseArea2.pressed ? 0.9 : 1.0

        MouseArea {
            id: mouseArea2
            anchors.fill: parent

            Text {
                id: text3
                y: 99
                text: qsTr("模式")
                font.family: "微软雅黑"
                font.bold: true
                anchors.left: parent.left
                anchors.leftMargin: 80
                anchors.verticalCenter: parent.verticalCenter
                font.pixelSize: 28
            }
        }
    }

    Rectangle {
        id: rectangle3
        x: 355
        y: 252
        width: 325
        height: 210
        color: "#ffffff"
        radius: 20
        scale: mouseArea3.pressed ? 0.9 : 1.0

        MouseArea {
            id: mouseArea3
            anchors.fill: parent

            Text {
                id: text4
                x: 174
                y: 110
                text: qsTr("设置")
                font.family: "微软雅黑"
                font.bold: true
                anchors.right: parent.right
                anchors.rightMargin: 100
                anchors.verticalCenter: parent.verticalCenter
                font.pixelSize: 28
            }
        }
    }

    Rectangle {
        id: rectangle4
        x: 216
        y: 133
        width: 300
        height: 300
        color: "#26363d"
        radius: 150
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter

        Rectangle {
            id: rectangle5
            x: 50
            y: 50
            width: 260
            height: 260
            color: "#ffffff"
            radius: 130
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.verticalCenter: parent.verticalCenter
            scale: mouseArea4.pressed ? 0.9 : 1.0
            MouseArea {
                id: mouseArea4
                scale: 0.9
                hoverEnabled: false
                anchors.fill: parent

                Text {
                    id: text1
                    x: 117
                    y: 123
                    text: qsTr("启动")
                    font.family: "微软雅黑"
                    font.bold: true
                    verticalAlignment: Text.AlignVCenter
                    horizontalAlignment: Text.AlignHCenter
                    anchors.horizontalCenter: parent.horizontalCenter
                    anchors.verticalCenter: parent.verticalCenter
                    font.pixelSize: 55
                }

                Text {
                    id: text6
                    x: 117
                    color: "#ff0000"
                    text: qsTr("Undefined")
                    opacity: 0
                    font.bold: true
                    verticalAlignment: Text.AlignVCenter
                    horizontalAlignment: Text.AlignHCenter
                    anchors.horizontalCenter: parent.horizontalCenter
                    anchors.top: text1.bottom
                    anchors.topMargin: 8
                    font.pixelSize: 14
                    font.family: "微软雅黑"
                }
            }
        }
    }

    Connections {
        target: mouseArea3
        onClicked: buttonItem.pageChanged(2)
    }

    Connections {
        target: mouseArea4
        onClicked: buttonItem.startTask()
    }

    Connections {
        target: mouseArea2
        onClicked: buttonItem.pageChanged(1)
    }
}
